#include<stdio.h>

/*
真题练习
    定义一个数组存储5个学生的名字
    并进行遍历
*/
int main()
{
    char strArr[5][50] = {
        "zhangsan",
        "wangerxiao",
        "cuihao",
        "tangbocheng",
        "xiyueshan"
    };//定义五个名字

    for (int i = 0; i < 5; i++)//遍历数组
    {
        char *str = strArr[i];
        printf("%s\n",str);
    }
    printf("-----------------------------\n");
    char *strArr2[5] = {
        "zhangsan",
        "wangerxiao",
        "cuihao",
        "tangbocheng",
        "xiyueshan"
    };//定义5个名字的指针，并依次存储到数组中

    for (int i = 0; i < 5; i++)//遍历指针数组
    {
        char *str = strArr2[i];
        printf("%s\n",str);
    }
    

    return 0;
}
